package Cy.Servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import Cy.DAO.EvaluateDAO;
import Factory.EvaluateFactory;

/**
 * Servlet implementation class DeleteevaluateServlet
 */
@WebServlet("/deleteevaluate")
public class DeleteevaluateServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private EvaluateDAO evaluateDAO = EvaluateFactory.createDAO();
	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
		PrintWriter out = response.getWriter();
		int cid = Integer.parseInt(request.getParameter("cid"));
		String erorr = evaluateDAO.deleteevaluate(cid);
		out.print(erorr);
	}

}
